<div ng-controller="pureDetailsCtrl" ng-init="init()">
    <div class="bg-light lter b-b wrapper-md">
        <span class="m-n font-thin h3">
            <b translate="common.application"></b>
            <b>{{'servicetype.servicetype_' + serviceType.service_Id | translate}}</b>
            <b> - </b>
            <b translate="common.confirm"></b>
        </span>
        <span ng-if="!isSmart" class="pull-right"><a class="btn btn-primary" ui-sref="app.process.service({service_Id:service_Id})"><span
                translate="common.backList"></span></a></span>
    </div>
    <form method="post">
        <div ng-class="isSmart?'':'wrapper-md'">
            <div class="row service-create">
                <div class="col-md-6">
                    <div class="panel panel-default service-create-left">
                        <div class="pure-panel-margin">
                            <h3 translate="user.basic">basic</h3>

                            <div class="pure-details" ng-repeat="detail in patient">
                                <div class="row">
                                    <div class="col-lg-5"><span translate="common.name">Name</span>:<span>{{ detail._user.realName }}</span>
                                    </div>
                                    <div class="col-lg-7"><span translate="user.gender">Gender</span>:<span translate="{{ 'user.gender.' + detail._user.gender}}"></span>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-5"><span
                                            translate="common.age">Age</span>:<span>{{ detail._user.age }}</span></div>
                                    <div class="col-lg-7"><span translate="user.mobilephone">Mobile phone</span>:<span>{{ detail._user.mobile_Phone }}</span>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-12">
                                        <span translate="business.patcase.brief_Desc">Brief description</span>:
                                        <span>{{ patientPackage.patCase.brief_Desc }}</span>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-offset-8">
                                        <button type="button" class="btn btn-warning font-bold service-create-btnstyle"
                                                ng-click="open({ templateUrl: 'editPatient.html'}, detail.patient_Id)">
                                            <span translate="business.navtitle.editpatinfo">Edit Patient info</span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="panel panel-default service-create-right">
                        <div class="pure-panel-margin">
                            <h3 translate="business.servreq.choose_specialist">Choose Specialist</h3>

                            <div class="pure-specialist">
                                <div class="row">
                                    <span class="text-danger" translate="common.ChooseSpecialistNotice"></span>
                                </div>
                                <div class="row">
                                    <div>
                                        <span translate="common.selected">selected</span>:
                                        <input class="pure-specialist-input" ng-model="chosen_Expert.realName"
                                               name="valname" id="valname" readOnly="true"/>
                                        <span translate="dashboard.specialist">Specialists</span>
                                        <button class="btn btn-success"
                                                ng-click="openSpecialist({ templateUrl: 'chooseSpecialist.html', size: 'lg' }, selected.item);">
                                            <em class="fa fa-share"></em>
                                            <span class="font-bold" translate="business.servreq.you_choose_specialist">You Choose Specialist</span>
                                        </button>
                                    </div>
                                </div>
                                <div class="row">
                                    <button class="btn btn-danger pull-right font-bold" style="margin-top: 3rem;"
                                            ng-click="clear()">
                                        <span translate="common.clearSpecialist"></span>
                                    </button>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal-footer">
            <a type="submit" class="btn btn-success btn-lg font-bold"
               ng-click="createServReq()"
               translate="common.confirm">Confirm
            </a>
        </div>
    </form>
</div>

<script type="text/ng-template" id="chooseSpecialist.html">
    <div ng-init="initSpecialist()">
        <div class="modal-header">
            <button type="button" class="close" ng-click="cancel()"><span class="icon icon-close" aria-hidden="true"></span></button>
            <h4 translate="business.patcase.send_for_diagnosis_confirm"></h4>
        </div>
        <div class="modal-body">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th><span translate="common.number"></span></th>
                    <th><span translate="common.name"></span></th>
                    <th ng-if="!isSmart"><span translate="user.gender"></span></th>
                    <th><span translate="servicecreate.hospital"></span></th>
                    <th ng-if="!isSmart"><span translate="servicecreate.departments"></span></th>
                    <th ng-if="!isSmart" translate="user.mobilephone"></th>
                    <th><span translate="common.operate"></span></th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="item in specialists">
                    <td><span>{{$index+1}}</span></td>
                    <td>{{item.realName}}</td>
                    <td ng-if="!isSmart">{{'user.gender.' + item.gender | translate}}</td>
                    <td>{{item._doctor._hosp.hosp_Cn_Name}}</td>
                    <td ng-if="!isSmart">{{ (selectLang == 'English') ? item._doctor._dept.dept_En_Name : item._doctor._dept.dept_Cn_Name }}</td>
                    <td ng-if="!isSmart">{{item.mobile_Phone}}</td>
                    <td>
                        <button type="button" class="btn btn-sm btn-danger"
                                ng-click="setSpecialist(item.userId)"
                                translate="common.select">select
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div class="modal-footer">
            <button class="btn btn-default" ng-click="cancel()" translate="common.close"></button>
        </div>
    </div>
</script>

<div ng-include="'views/work/templates.html'"></div>

